﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using octopus_project.tileset;
using octopus_project.enumeration;
using octopus_project.scene.cannon.weapon;

namespace octopus_project.typegame {
    abstract class Stats {

        protected byte terrainConquered;
        protected bool hasCastle;
        protected List<Weapon> weaponList;

        public List<Weapon> WeaponList {
            get { return weaponList; }
        }

        public byte TerrainConquered {
            get { return terrainConquered; }
        }
        
        public void terrainConquering() {
            terrainConquered++;
        }
        public static void terrainConquering(TileMap_GameplayEntry tileMap) {
            foreach (Player aPlayer in Game1.Players.Values) {
                aPlayer.Stats.resetData();
                aPlayer.Stats.hasCastle = false;
            }
            // initial pass
            for (byte y = 0; y < Constant.TOTAL_TILES_Y; y++)
                for (byte x = 0; x < Constant.TOTAL_TILES_X; x++) {

                    MapCell cell = tileMap.getMapCell(x, y);
                    if (cell.player != null && cell.tileType != enumeration.TileType.PLAYER_WALL) {
                        cell.player.Stats.terrainConquering();
                        //cell.player.Stats.weapons(cell.tileType);
                        if (cell.castle) {
                            cell.player.Stats.hasCastle = true;
                        }
                    }
                }
        
        }
        public bool HasCastle {
            get { return hasCastle; }
        }

        abstract public Damage shotting();
       // abstract public void resetShots();
        abstract public void resetData();
        abstract public Weapon nextWeapon();
    }
}
